using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace MIMP
{
    class SaveGameScreen : MenuScreen
    {
        public SaveGameScreen()
            : base("Choose a file to save.")
        {
            for(int i=1;i<=10;i++)
            {
                string name = "Save file " + i;
                MenuEntry entry = new MenuEntry(name);
                entry.Selected += new EventHandler<EventArgs>(SaveGame);
                MenuEntries.Add(entry);
            }
        }

        void SaveGame(object sender, EventArgs e)
        {
            MenuEntry selected = (MenuEntry)sender;
            IGameStateService gs = (IGameStateService)ScreenManager.Game.Services.GetService(typeof(IGameStateService));
            gs.SaveGame(selected.Text);
            ExitScreen();
        }
    }
}
